﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL;

namespace BIZ
{
    public class CartObject
    {
        public PRODUCT Product { get; set; }
        public int Quantity { get; set; }

        public CartObject(PRODUCT product, int quantity)
        {
            this.Product = product;
            this.Quantity = quantity;
        }

        public CartObject(string text)
        {
            string[] str = text.Split(',');
            this.Product = new PRODUCT() { ProductID = new Guid(str[0]) };
            this.Quantity = int.Parse(str[1]);
        }

        public override string ToString()
        {
            return Product.ProductID + "," + Quantity;
        }
    }
}
